﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Zj.HttpCodeDemo.Domain.Events
{
    public interface IEventExcutionContext
    {
        void Registe<TEvent, TEventHandler>(TEvent @event, TEventHandler eventHandler)
            where TEvent:IEvent
            where TEventHandler:IEventHandler;
        void Registe(Type eventType, Type eventHandlerType);
        Task RegistesAsync<TEvent, TEventHandler>(TEvent @event, TEventHandler eventHandler)
            where TEvent : IEvent
            where TEventHandler : IEventHandler;
        Task RegisteAsync(Type eventType, Type eventHandlerType);
        Task HandleEventAsync<TEvent>(TEvent @event)
            where TEvent : IEvent;

         bool HandlerRegistered<TEvent, TEventHandler>(TEvent @event, TEventHandler eventHandler)
            where TEvent : IEvent
            where TEventHandler : IEventHandler;

        bool HandlerRegistered(Type eventType, Type eventHandlerType);
    }
}
